<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */

//取出此期賽程
if(is_array($_arrGamble))list($intGID, $arrGamble) = each($_arrGamble);
if(empty($intGID)){
	$arrGamble = getNewGambleData($intLottoID, 0);
	if($arrGamble === false){
		ErrMsgOutputHTML("Error", "", 1);
	}
	if(sizeof($arrGamble) == 0){
		$arrGamble = getNewGambleData($intLottoID, 1);
		if($arrGamble === false){
			ErrMsgOutputHTML("Error", "", 1);
		}
	}
	$intGID = $arrGamble["ID"];
}

if(!empty($intGID))$_strGDate = DateForm($arrGamble["GameDate"], $arrGamble["GameTime"], "Y-m-d", "UToC")."&nbsp;".TimeForm($arrGamble["GameDate"], $arrGamble["GameTime"], "h:i a", "UToC");

$arrTmp = split("-", $arrLotto["Number"]);
for($i = intval($arrTmp[0]); $i <= intval($arrTmp[1]); $i++)$_strNumber .= $i.",";
$_strNumber = substr($_strNumber, 0, strlen($_strNumber) - 1);
?><!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> <?php print $_strRealBet10M["Title"];?> (Add) </title>
<link rel="stylesheet" href="../../css/backend.css?time=01" type="text/css">
<script language="JavaScript1.2" type="text/javascript" src="/inc/RealBetTemp10M<?php print $_intLang?>.js?time=01"></script>
<script language="JavaScript1.2" type="text/javascript" src="/common/betparam/AnimalsParams_<?php print $intLottoID;?>.js?time=01"></script>
<script language="JavaScript">
<!--
var Game1 = new Array(), Game2 = new Array(), Game3 = new Array(), Game4 = new Array();
var Game5 = new Array(), Game6 = new Array(), Game7 = new Array(), Game8 = new Array();
var Game9 = new Array(), Game10 = new Array();
var Game11 = new Array(), Game12 = new Array(), Game13 = new Array();
var Game15 = new Array(), Game16 = new Array();
var Game17 = new Array(), Game18 = new Array(), Game19 = new Array(), Game20 = new Array();
var Game21 = new Array(), Game22 = new Array(), Game23 = new Array(), Game24 = new Array();
var Game25 = new Array(), Game26 = new Array(), Game27 = new Array(), Game28 = new Array();
var Game29 = new Array();
var Game30 = new Array(), Game31 = new Array(), Game32 = new Array(), Game33 = new Array(), Game34 = new Array(), Game35 = new Array();
//var strGameTime = "<?php print $_strGDate;?>";
//var strGameNo = "<?php print $arrGamble["SerialNo"];?>";
var intSortPlus = -1;
var strLottoNum = "<?php print $_strNumber;?>";
var arrSpecialNum = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var arrSpecialCon = new Array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
var BColor_Index = new Array(<?php print $arrLotto["ColorSet"];?>);
var BColor_Value = new Array("red","blue","green");
var strLottoID = "<?php print $intLottoID;?>";
var strBetType = "1,2,3,4";
var RSeconds = 0;
var intSortSite = 0;
var AutoRefreshID = 0;
var sumStake = new Array(), sumPayOff = new Array(), sumCommission = new Array(), sumWStake = new Array();
sumStake[11] = new Array();
sumStake[12] = new Array();
sumStake[13] = new Array();
sumPayOff[11] = new Array();
sumPayOff[12] = new Array();
sumPayOff[13] = new Array();
sumCommission[11] = new Array();
sumCommission[12] = new Array();
sumCommission[13] = new Array();

var strT1 = "<?php print $_strRealBet10M["SpecialNumber"];?>", strT5 = "<?php print $_strRealBet10M["NormalSpecial1"];?>", strT11 = "<?php print $_strRealBet10M["NormalNumber1_4"];?>", strT14 = "<?php print $_strRealBet10M["NormalNumberParlays"];?>", strT15 = "<?php print $_strRealBet10M["JoinNumber"];?>", strT25 = "<?php print $_strRealBet10M["FiveNotWin"];?>", strT29 = "<?php print $_strRealBet10M["Mantissa"];?>", strT30 = "<?php print $_strRealBet10M["MantissaJN"];?>", strTSG = "<?php print $_strRealBet10M["StartGame"];?>";

var RefreshSec = 20, intRefreshSec = 0, isRefresh = true, isLimit = false;
var arrBTTip5 = new Array('<?php print $_strRealBet10M["BT5"];?>', '<?php print $_strRealBet10M["BT6"];?>', '<?php print $_strRealBet10M["BT7"];?>', '<?php print $_strRealBet10M["BT8"];?>');
var arrBTTip15 = new Array('<?php print $_strRealBet10M["BT15"];?>', '<?php print $_strRealBet10M["BT16"];?>', '<?php print $_strRealBet10M["BT17"];?>', '<?php print $_strRealBet10M["BT18"];?>', '<?php print $_strRealBet10M["BT19"];?>', '<?php print $_strRealBet10M["BT20"];?>', '<?php print $_strRealBet10M["BT21"];?>', '<?php print $_strRealBet10M["BT22"];?>', '<?php print $_strRealBet10M["BT23"];?>', '<?php print $_strRealBet10M["BT24"];?>');
var arrBTTip25 = new Array('<?php print $_strRealBet10M["BT25"];?>', '<?php print $_strRealBet10M["BT26"];?>', '<?php print $_strRealBet10M["BT27"];?>', '<?php print $_strRealBet10M["BT28"];?>');

//平碼或特碼初始化
function iniNumber(intBT){
	var arrNumber = new Array();
	switch(intBT){
		case 1:
			document.getElementById("BetList").innerHTML = strLayer1;
			break;

		case 5:
		case 6:
		case 7:
		case 8:
			document.getElementById("BetList").innerHTML = strLayer5;
			break;

		case 25:
		case 26:
		case 27:
		case 28:
			document.getElementById("BetList").innerHTML = strLayer25;
			break;

		default:
			document.getElementById("BetList").innerHTML = strLayer15;
			break;
	}

	arrNumber = strLottoNum.split(",");
	for(var i = 1; i <= arrNumber.length; i++){
		document.getElementById("Num"+i).innerHTML = "<a href=\"JavaScript:StopBet("+intBT+", "+i+")\" class=\"G_Con_Numer_blue\">" + ((i < 10)?"0"+i:i) + "</a>";
	}
	if(intBT != 1){
		GetOdds();
		return;
	}
	document.getElementById("OddOddsTD").innerHTML = "+&nbsp;<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+i+")\">0.00</a>&nbsp;-<br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/
	document.getElementById("EvenOddsTD").innerHTML = "<a class=\"G_Con_Odds\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/

	document.getElementById("OverOddsTD").innerHTML = "+&nbsp;<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+i+")\">0.00</a>&nbsp;-<br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/
	document.getElementById("UnderOddsTD").innerHTML = "<a class=\"G_Con_Odds\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/

	document.getElementById("SumOddOddsTD").innerHTML = "+&nbsp;<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+i+")\">0.00</a>&nbsp;-<br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/
	document.getElementById("SumEvenOddsTD").innerHTML = "<a class=\"G_Con_Odds\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/

	GetOdds();
}

function changSort(){
	intSortPlus *= -1;
	changSortClass();
	RefreshType();
}

function changSortClass(){
	document.getElementById("TenSortLink").innerHTML = (intSortPlus == -1)?"<?php print $_strRealBet10M["TenLoseSort"];//十大負值排行?>":"<?php print $_strRealBet10M["TenWinSort"];//十大正值排行?>";
	document.getElementById("TenSortTD").className = (intSortPlus == -1)?"G_Con_SortLoseTD":"G_Con_SortWinTD";
}

function ValueSort(arrValue, intValue, intNum, strCon){
	var i = 0, intTmp = 0, intTmp2 = 0, isMoveDown = false, strCon1 = "", strCon2 = "", intNum1 = 0, intNum2 = 0;
	for(i = 0; i < arrValue.length; i++){
		if(isMoveDown == false){
			if(arrValue[i] < intValue){
				intTmp = arrValue[i];
				intNum1 = arrSpecialNum[i];
				strCon1 = arrSpecialCon[i];
				arrValue[i] = intValue;
				arrSpecialNum[i] = intNum;
				arrSpecialCon[i] = strCon;
				isMoveDown = true;
			}
		}else{
			if(isMoveDown == true){
				intTmp2 = arrValue[i];
				intNum2 = arrSpecialNum[i];
				strCon2 = arrSpecialCon[i];
				arrValue[i] = intTmp;
				arrSpecialNum[i] = intNum1;
				arrSpecialCon[i] = strCon1;
				intTmp = intTmp2;
				intNum1 = intNum2;
				strCon1 = strCon2;
			}
		}
	}
	return arrValue;
}

//顯示數字賠率，給 iframe 用
function ShowNumberOdds(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), OverBetOn, OverBet, OverBetColor, sumOdds = 0, maxPayOff = 0, intTmp = 0, preWin = 0, strClass = "", strCon = "";//, sumPayOff = 0;

	//數字
	var arrN = new Array(-1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000);
	arrTmpGame	= eval("Game"+intBT);

	for(var i = 1; i < arrTmpGame.length; i++){
		intNum = parseInt(arrTmpGame[i][3]);
		//document.getElementById("OddsTD"+intNum).style.background = "#FFFFFF";

		strCon = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a>";
		document.getElementById("Num"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		document.getElementById("OddsTD"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		if(arrTmpGame[i][11] == "1"){
			document.getElementById("OddsTD"+intNum).className = "G_Con_TD_SelfDark";
		}
		sumOdds += 1 / parseFloat(arrTmpGame[i][5]);
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);

		if(maxPayOff < intTmp)maxPayOff = intTmp;
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		arrN = ValueSort(arrN, preWin*intSortPlus, intNum, strCon);

		document.getElementById("OddsTD"+intNum).innerHTML = strCon;
	}
	document.getElementById("SumStakeValue").innerHTML = Math.round(sumStake[intBT]);

	document.getElementById("MaxLose").innerHTML = Math.round(sumStake[intBT] - maxPayOff - sumCommission[intBT]);
	changSortClass();
	for(var i = 0; i < arrSpecialNum.length; i++){
		intNum = arrSpecialNum[i];
		document.getElementById("Sort"+(i+1)).innerHTML = "<a href=\"JavaScript:StopBet(1, "+intNum+")\" class=\"G_Con_Numer_blue\">" + ((intNum < 10)?"0"+intNum:intNum) + "</a>";
		document.getElementById("SortTD"+(i+1)).innerHTML = arrSpecialCon[i];
		document.getElementById("Sort"+(i+1)).className = document.getElementById("Num"+intNum).className;
		document.getElementById("SortTD"+(i+1)).className = document.getElementById("OddsTD"+intNum).className;
	}

	if(intBT != 1)return;

	//單雙
	arrTmpGame	= Game2;
	intBT = 2;
	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = parseInt(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "OddOddsTD";
			strTip = "OddTip";

			intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			document.getElementById(strTD).innerHTML = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		}else{
			strTD = "EvenOddsTD";
			strTip = "EvenTip";

			intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			document.getElementById(strTD).innerHTML = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		}
		document.getElementById(strTD).style.background = "#FFFFFF";

		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.getElementById(strTip).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		if(arrTmpGame[i][11] == "1"){
			document.getElementById(strTD).className = "G_Con_TD_SelfDark";
		}
	}

	//大小
	arrTmpGame	= Game3;
	intBT = 3;
	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = parseInt(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "OverOddsTD";
			strTip = "OverTip";

			intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			document.getElementById(strTD).innerHTML = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		}else{
			strTD = "UnderOddsTD";
			strTip = "UnderTip";

			intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			document.getElementById(strTD).innerHTML = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		}
		document.getElementById(strTD).style.background = "#FFFFFF";

		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.getElementById(strTip).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		if(arrTmpGame[i][11] == "1"){
			document.getElementById(strTD).className = "G_Con_TD_SelfDark";
		}
	}

	//合數單雙
	arrTmpGame	= Game4;
	intBT = 4;
	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = parseInt(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "SumOddOddsTD";
			strTip = "SumOddTip";

			intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			document.getElementById(strTD).innerHTML = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		}else{
			strTD = "SumEvenOddsTD";
			strTip = "SumEvenTip";

			intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			document.getElementById(strTD).innerHTML = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		}

		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.getElementById(strTip).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		if(arrTmpGame[i][11] == "1"){
			document.getElementById(strTD).className = "G_Con_TD_SelfDark";
		}
	}
}

//尾數 初始化
function iniMantissa(){
	document.getElementById("ListStatus").innerHTML = strT29;
	document.getElementById("BetList").innerHTML = strLayer29;
	GetOdds();
}

//顯示一般尾數賠率表
function ShowMantissaOdds(){
	var k, arrTmpGame = new Array(), objTD, intTmp = 0, preWin = 0, strClass = "";
	//一般尾數
	arrTmpGame = Game29;
	intBT = 4;
	for(k = 0; k <= 9; k++){
		intTmp = parseFloat(arrTmpGame[k][9]) + parseFloat(arrTmpGame[k][8]);
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

		objTD = document.getElementById("OddsTD29_"+k.toString());
		objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:void(0)\">"+arrTmpGame[k][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+",0)\">"+arrTmpGame[k][7]+"/"+Math.round(parseFloat(arrTmpGame[k][8])).toString()+"</a>";
		objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark":"";
	}
}

//平碼 1-4 初始化
function iniNormalNumber1_4(isParlays){
	if(isParlays == 1){
		document.getElementById("ListStatus").innerHTML = strT14;
		document.getElementById("BetList").innerHTML = strLayer14;
	}else{
		document.getElementById("ListStatus").innerHTML = strT11;
		document.getElementById("BetList").innerHTML = strLayer11;
	}
	GetOdds();
}

//顯示平碼 1-4 及過關賠率表
function ShowNormalNumber1_4Odds(isParlays){
	var i, j, k, m, arrBT = new Array(11,12,13), arrTmpGame = new Array(), objTD, intID, intMax, intTmp = 0, preWin = 0, strClass = "";
	if(isParlays == 1)arrBT = new Array(11,12,13);

	for(m = 0; m < arrBT.length; m++){
		intBT = arrBT[m];
		arrTmpGame = eval("Game" + intBT);
		intMax = 1;
		for(j = 1; j <= 4; j++){
			preWin = sumStake[intBT][j] - sumCommission[intBT][j];

			for(k = 0; k <= intMax; k++){
				intID = j*10 + k;
				objTD = document.getElementById("OddsTD"+intBT.toString()+"_"+intID.toString());
				if(k == 1){
					objTD.innerHTML = "<a class=\"G_Con_Odds\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+arrTmpGame[intID][7]+"/"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a>";
					if(isParlays != 1){
						intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
						strClass = ((preWin-intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
						objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin-intTmp).toString()+"</a>";
					}
				}else{
					if(isParlays == 1){
						objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:void(0)\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+arrTmpGame[intID][7]+"/"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a>";
					}else{
						intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
						strClass = ((preWin-intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
						objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:void(0)\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+arrTmpGame[intID][7]+"/"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin-intTmp).toString()+"</a>";
					}
				}
				objTD.className = (arrTmpGame[intID][6] == "1")?"G_Con_TD_Dark":"";
			}
		}
	}
	if(isParlays == 1)return;

	for(intBT = 9; intBT <= 10; intBT++){
		arrTmpGame = eval("Game" + intBT);

		preWin = sumStake[intBT] - sumCommission[intBT];
		for(k = 0; k <= 1; k++){
			intID = k;
			objTD = document.getElementById("OddsTD"+intBT.toString()+"_"+intID.toString());
			if(k == 1){
				objTD.innerHTML = "<a class=\"G_Con_Odds\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+arrTmpGame[intID][7]+"/"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a>";

				intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
				strClass = ((preWin-intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
				objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin-intTmp).toString()+"</a>";

			}else{
				intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
				strClass = ((preWin-intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
				objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:void(0)\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+arrTmpGame[intID][7]+"/"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin-intTmp).toString()+"</a>";
			}
			objTD.className = (arrTmpGame[intID][6] == "1")?"G_Con_TD_Dark":"";
		}
	}
}

//顯示連碼賠率表
function ShowJoinNumberOdds(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), OverBetOn, OverBet, OverBetColor, sumOdds = 0, maxPayOff = 0, intTmp = 0, preWin = 0, strClass = "", strCon = "";//, sumPayOff = 0;

	//數字
	var arrN = new Array(-1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000);
	arrTmpGame	= eval("Game"+intBT);

	for(var i = 1; i < arrTmpGame.length; i++){
		intNum = parseInt(arrTmpGame[i][3]);
		//document.getElementById("OddsTD"+intNum).style.background = "#FFFFFF";

		strCon = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a>";
		document.getElementById("Num"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		document.getElementById("OddsTD"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		if(arrTmpGame[i][11] == "1"){
			document.getElementById("OddsTD"+intNum).className = "G_Con_TD_SelfDark";
		}
		sumOdds += 1 / parseFloat(arrTmpGame[i][5]);
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);

		if(maxPayOff < intTmp)maxPayOff = intTmp;
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		arrN = ValueSort(arrN, preWin*intSortPlus, intNum, strCon);

		document.getElementById("OddsTD"+intNum).innerHTML = strCon;
	}
	document.getElementById("SumStakeValue").innerHTML = Math.round(sumStake[intBT]);

	//document.getElementById("MaxLose").innerHTML = Math.round(sumStake[intBT] - maxPayOff - sumCommission[intBT]);
	changSortClass();
	for(var i = 0; i < arrSpecialNum.length; i++){
		intNum = arrSpecialNum[i];
		document.getElementById("Sort"+(i+1)).innerHTML = "<a href=\"JavaScript:StopBet(1, "+intNum+")\" class=\"G_Con_Numer_blue\">" + ((intNum < 10)?"0"+intNum:intNum) + "</a>";
		document.getElementById("SortTD"+(i+1)).innerHTML = arrSpecialCon[i];
		document.getElementById("Sort"+(i+1)).className = document.getElementById("Num"+intNum).className;
		document.getElementById("SortTD"+(i+1)).className = document.getElementById("OddsTD"+intNum).className;
	}
}


//顯示 五不中
function ShowFiveNotWinNumber(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), OverBetOn, OverBet, OverBetColor, sumOdds = 0, maxPayOff = 0, intTmp = 0, preWin = 0, strClass = "", strCon = "";//, sumPayOff = 0;

	//數字
	var arrN = new Array(-1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000);
	arrTmpGame	= eval("Game"+intBT);

	for(var i = 1; i < arrTmpGame.length; i++){
		intNum = parseInt(arrTmpGame[i][3]);
		//document.getElementById("OddsTD"+intNum).style.background = "#FFFFFF";

		strCon = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][7]+"/"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a>";
		document.getElementById("Num"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		document.getElementById("OddsTD"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		if(arrTmpGame[i][11] == "1"){
			document.getElementById("OddsTD"+intNum).className = "G_Con_TD_SelfDark";
		}
		sumOdds += 1 / parseFloat(arrTmpGame[i][5]);
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);

		if(maxPayOff < intTmp)maxPayOff = intTmp;
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		arrN = ValueSort(arrN, preWin*intSortPlus, intNum, strCon);

		document.getElementById("OddsTD"+intNum).innerHTML = strCon;
	}
	document.getElementById("SumStakeValue").innerHTML = Math.round(sumStake[intBT]);

	//document.getElementById("MaxLose").innerHTML = Math.round(sumStake[intBT] - maxPayOff - sumCommission[intBT]);
	changSortClass();
	for(var i = 0; i < arrSpecialNum.length; i++){
		intNum = arrSpecialNum[i];
		document.getElementById("Sort"+(i+1)).innerHTML = "<a href=\"JavaScript:StopBet(1, "+intNum+")\" class=\"G_Con_Numer_blue\">" + ((intNum < 10)?"0"+intNum:intNum) + "</a>";
		document.getElementById("SortTD"+(i+1)).innerHTML = arrSpecialCon[i];
		document.getElementById("Sort"+(i+1)).className = document.getElementById("Num"+intNum).className;
		document.getElementById("SortTD"+(i+1)).className = document.getElementById("OddsTD"+intNum).className;
	}
}


//尾數連 初始化
function iniBT3035Numer(intBT){
	document.getElementById("ListStatus").innerHTML = strT30;
	document.getElementById("BetList").innerHTML = strLayer30;
	GetOdds();
}

//顯示 尾數連 數字賠率
function ShowBT3035Number(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, OverBetOn, OverBet, OverBetColor, intBT, preWin = 0, strClass = "", strCon = "", flOdds = 0, flComm, intSumStake = 0;// sumPayOff = 0,
	var arrBT = new Array(30, 31, 32, 33, 34, 35);
	var arrBTMinNum = new Array(0, 0, 0, 0, 0, 0);
	var arrBTMaxNum = new Array(9, 9, 9, 9, 9, 9);
	var strTDSite = "";

	for(var i = 0; i < arrBT.length; i++){
		intBT = arrBT[i];
		arrTmpGame = eval("Game" + intBT.toString());
		intSumStake = 0;

		for(var intNum = arrBTMinNum[i]; intNum <= arrBTMaxNum[i]; intNum++){
			strTDSite = intBT.toString() + "_" + intNum.toString();

			strCon = "<a class=\"G_Con_Odds\" href=\"JavaScript:void(0)\">"+arrTmpGame[intNum][5]+"</a><br />";
			strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum+",0,"+intNum+")\">"+Math.round(parseFloat(arrTmpGame[intNum][8])).toString()+"</a>";//+arrTmpGame[intNum][7]+"/"
			document.getElementById("OddsTD"+strTDSite).innerHTML = strCon;

			document.getElementById("Num"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
			document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

			intSumStake += parseFloat(arrTmpGame[intNum][8]);
		}
		document.getElementById("SumWagerTD"+intBT.toString()).innerHTML = Math.round(intSumStake);
	}	//for(var i = 0; i < arrBT.length; i++)
}

//開放停押，所有號碼和項目
function StopAllBet(isStop, strBT){
	return false;
}
//開放停押，只單一號碼或項目
function StopBet(intBT, intNum){
	return false;
}

function CountRefresh(){
	if(intRefreshSec >= RefreshSec)isRefresh = true;
	intRefreshSec++;
}

//取得賠率樣版
function GetTemplate(){
	setInterval("CountRefresh();", 1000);
	if(strLayer1)return;
	with(document.getDataForm){
		op.value = "GetTemplate";
		submit();
	}
}

//取得賠率
function GetOdds(){
	if(isRefresh == false && isLimit == true){
		document.getDataForm.action = "https://tw.i1.yimg.com/tw.yimg.com/i/tw/weather/02.gif";
		document.getDataForm.submit();
		window.status = "";
		isLimit = false;
		return;
	}

	with(document.getDataForm){
		action = "index.php";
		Bet_Type.value = strBetType;
		op.value = "GetOdds";
		submit();
	}
	isRefresh = false;
	intRefreshSec = 0;
	isLimit = false;
}

function checkOdds(){
	document.getElementById("odds_win").style.display = "none";
	return true;
}

//給選擇樂透種類下拉選單用
function LottoSelect(){
	with(document.OddsListForm){
		target = "_self";
		switch(LottoID.value){
			case "1":
				action = "/k_admin/RealBet/index.php";
				break;

			case "2":
			case "3":
			case "6":
			case "7":
			case "8":
				action = "/k_admin/RealBet3D/index.php";
				break;

			case "4":
				action = "/k_admin/RealBet7Star/index.php";
				break;

			case "5":
				action = "/k_admin/RealBet10M/index.php";
				break;
		}
		submit();
	}
}

//更改下注種類賠率表
function ChangeBet(intBT){
	close_WagerWin();
	document.getDataForm.SpecialNumType.value = "0";
	switch(intBT){
		//特碼
		case 1:
			document.getElementById("ListStatus").innerHTML = strT1;
			strBetType = "1,2,3,4";
			document.getDataForm["Bet_Type"].value = "1,2,3,4";
			document.getDataForm["isSpecial"].value = 1;
			iniNumber(1);
			break;
		//平1-4 特碼
		case 5:
		case 6:
		case 7:
		case 8:
			document.getElementById("ListStatus").innerHTML = arrBTTip5[intBT - 5];
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			document.getDataForm["isSpecial"].value = intBT;
			iniNumber(intBT);
			document.getElementById("TwinTip"+intBT).style.color = "#FF9900";
			document.getElementById("TwinBT"+intBT).checked = true;
			break;
		//連碼
		case 15:
		case 16:
		case 17:
		case 18:
		case 19:
		case 20:
		case 21:
		case 22:
		case 23:
		case 24:
			document.getElementById("ListStatus").innerHTML = arrBTTip15[intBT - 15];
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			document.getDataForm["isSpecial"].value = 0;
			iniNumber(intBT);
			document.getElementById("TwinTip"+intBT).style.color = "#FF9900";
			document.getElementById("TwinBT"+intBT).checked = true;
			break;
		//平碼 1-4
		case 11:
			document.getElementById("ListStatus").innerHTML = strT11;
			strBetType = "9,10,11,12,13";
			document.getDataForm["Bet_Type"].value = "9,10,11,12,137";
			document.getDataForm["isSpecial"].value = 0;
			iniNormalNumber1_4(0);
			break;
		//平碼 過關
		case 14:
			document.getElementById("ListStatus").innerHTML = strT14;
			strBetType = "14";
			document.getDataForm["Bet_Type"].value = "14";
			document.getDataForm["isSpecial"].value = 0;
			iniNormalNumber1_4(1);
			break;
		//五不中
		case 25:
		case 26:
		case 27:
		case 28:
			document.getElementById("ListStatus").innerHTML = arrBTTip25[intBT - 25];
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			document.getDataForm["isSpecial"].value = intBT;
			iniNumber(intBT);
			document.getElementById("TwinTip"+intBT).style.color = "#FF9900";
			document.getElementById("TwinBT"+intBT).checked = true;
			break;
		//尾數
		case 29:
			document.getElementById("ListStatus").innerHTML = strT29;
			strBetType = "29";
			document.getDataForm["Bet_Type"].value = "29";
			document.getDataForm["isSpecial"].value = 0;
			iniMantissa();
			break;
		//尾數連
		case 30:
			document.getElementById("ListStatus").innerHTML = strT30;
			strBetType = "30,31,32,33,34,35";
			document.getDataForm["Bet_Type"].value = "30,31,32,33,34,35";
			document.getDataForm["isSpecial"].value = 0;
			iniBT3035Numer(30);
			break;
	}
}

//顯示以開獎表格
function StartGame(){
	var KGame = new Array(), strGID = "", strBID = "";
	close_WagerWin();
	document.getDataForm.op.value = "StartGame";
	document.getElementById("BetList").innerHTML = strLayerStart;
	document.getElementById("ListStatus").innerHTML = strTSG;
	var objOTable = document.getElementById("OddsTable");
	var docloc="getWagerStart.xml.php?LottoID="+strLottoID+"&isStop=0";
	if (document.implementation && document.implementation.createDocument) {
		KGameDOM = document.implementation.createDocument("", "", null);
	} else if (window.ActiveXObject) {
		KGameDOM = new ActiveXObject("Microsoft.XMLDOM");
		KGameDOM.async = false;
	}
	KGameDOM.load(docloc);
	var root = KGameDOM.documentElement;

	if(root == null)return;
	with(objOTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < root.childNodes.length; i++) {
			newTR = insertRow();
			newTR.className = "G_Con_TR";
			with(newTR){
				if (root.childNodes.item(i).tagName == "WagerData") {
					KGame[i]=root.childNodes.item(i);
					newTD = insertCell();
					newTD.innerHTML = KGame[i].getElementsByTagName("GameDate").item(0).text + "&nbsp;" + KGame[i].getElementsByTagName("GameTime").item(0).text;

					newTD = insertCell();
					newTD.innerHTML = KGame[i].getElementsByTagName("GameNo").item(0).text;

					newTD = insertCell();
					newTD.align = "left";
					newTD.innerHTML = KGame[i].getElementsByTagName("BetType").item(0).text;

					strGID = KGame[i].getElementsByTagName("GambleID").item(0).text;
					strBID = KGame[i].getElementsByTagName("BID").item(0).text;
					newTD = insertCell();
					newTD.align = "left";
					newTD.id = "OddsTD"+strBID;
					if(document.getDataForm.isRealShow.value == "1"){
						newTD.innerHTML = "<a class=\"G_Con_Bet_Start\" href=\"JavaScript:getWagerData("+strGID+","+strBID+",-1,1)\">"+KGame[i].getElementsByTagName("CountNo").item(0).text+"&nbsp;/&nbsp;"+KGame[i].getElementsByTagName("RateMemStake").item(0).text+"</a>";
					}else{
						newTD.innerHTML = "<a class=\"G_Con_Bet_Start\" href=\"JavaScript:getWagerData("+strGID+","+strBID+",-1,1)\">"+KGame[i].getElementsByTagName("CountNo").item(0).text+"&nbsp;/&nbsp;"+KGame[i].getElementsByTagName("AllMemStake").item(0).text+"</a>";
					}
				}
			}
		}
	}
}

function ChangeGambleType(obj){
	with(document.getDataForm){
		ChangeGameType.value = "Yes";
		GameType.value = obj.value;
		submit();
		ChangeGameType.value = "No";
	}
}

function RefreshType(){
	with(document.getDataForm){
		if(op.value == "StartGame"){
			StartGame();
		}else{
			GetOdds();
		}
	}
}

function RClock(i){
	if (RSeconds == 0){
		intRefreshSec = 0;
		RefreshType();
		RSeconds = i;
	}
	RSeconds --;
	if(document.getElementById("RSec"))document.getElementById("RSec").innerHTML = RSeconds;
}

function ChangeRefreshSec(obj){
	if(AutoRefreshID > 0)clearInterval(AutoRefreshID);
	AutoRefreshID = setInterval("RClock("+obj.value+")",1000);
}

function ChangeReal(obj){
	document.getDataForm.isRealShow.value = obj.value;
	RefreshType();
}

function close_WagerWin(){
	document.getElementById("wager_win").style.display = "none";
}

var KGameDOM;
function getWagerData(GID, intBT, Num, isStop) {
	var KGame = new Array(), strTD = "", intGap = 0;
	var objWTable = document.getElementById("WagerTable");
	var objWLayer = document.getElementById("WagerLayer");
	var strBT = intBT;

	var docloc="getWager.xml.php?GambleID="+GID+"&Bet_Type="+strBT+"&Number="+Num+"&isStop="+isStop+"&isRealShow="+document.getDataForm.isRealShow.value;
	if(document.getDataForm.Bet_Type.value == "14")docloc+="&isParlays=1";
	if((intBT >= 15 && intBT <= 28) || (intBT >= 30 && intBT <= 35))docloc+="&isParlays=2";
	if (document.implementation && document.implementation.createDocument) {
		KGameDOM = document.implementation.createDocument("", "", null);
	} else if (window.ActiveXObject) {
		KGameDOM = new ActiveXObject("Microsoft.XMLDOM");
		KGameDOM.async = false;
	}
	KGameDOM.load(docloc);
	var root = KGameDOM.documentElement;

	if(root != null){
		if(Num == -1){
			strTD = "OddsTD"+intBT;
		}else{
			switch(intBT){
				case 1:
				case 5:
				case 6:
				case 7:
				case 8:
				case 15:
				case 16:
				case 17:
				case 18:
				case 19:
				case 20:
				case 21:
				case 22:
				case 23:
				case 24:
				case 25:
				case 26:
				case 27:
				case 28:
					strTD = "OddsTD"+Num;
					if(intSortSite != 0)strTD = "SortTD"+intSortSite;
					break;

				case 2:
					strTD = "OddOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				case 3:
					strTD = "OverOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				case 4:
					strTD = "SumOddOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				default:
					strTD = "OddsTD"+intBT+"_"+Num;
					break;
			}
		}
		document.getElementById("wager_win").style.top=document.getElementById(strTD).offsetTop+document.getElementById(strTD).clientHeight+72+intGap;
		if(document.getElementById("OddsTable").clientWidth < document.getElementById(strTD).offsetLeft + 483){
			document.getElementById("wager_win").style.left=document.getElementById(strTD).offsetLeft + document.getElementById(strTD).clientWidth - 487;
		}else{
			document.getElementById("wager_win").style.left=document.getElementById(strTD).offsetLeft;
		}
		document.getElementById("wager_win").style.display = "block";
	}else{
		close_WagerWin();
		return;
	}
	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < root.childNodes.length; i++) {
			newTR = insertRow();
			newTR.className = "Account_Con_BG";
			with(newTR){
				if (root.childNodes.item(i).tagName == "WagerData") {
					KGame[i]=root.childNodes.item(i);
					newTD = insertCell();
					newTD.align = "left";
					newTD.innerHTML = KGame[i].getElementsByTagName("BetDate").item(0).text + "&nbsp;" + KGame[i].getElementsByTagName("BetTime").item(0).text + "<br />" + KGame[i].getElementsByTagName("BetNo").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("Account").item(0).text;

					newTD = insertCell();
					newTD.innerHTML = KGame[i].getElementsByTagName("Content").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					strSymbol = (KGame[i].getElementsByTagName("WType").item(0).text == "<?php print $_SESSION["Admin_Info"] -> MemberGroup;?>")?"-":"";
					if(KGame[i].getElementsByTagName("OneStake").item(0).text != ""){
						newTD.innerHTML = strSymbol + KGame[i].getElementsByTagName("OneStake").item(0).text + "<br /><br />" + strSymbol + KGame[i].getElementsByTagName("Stake").item(0).text;
					}else{
						newTD.innerHTML = strSymbol + KGame[i].getElementsByTagName("Stake").item(0).text;
					}

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("Income").item(0).text;
				}
			}
		}
	}
	objWLayer.style.height = (objWTable.clientHeight > 300)?300:objWTable.clientHeight;
}
//-->
</script>
</head>

<body class="Mybody" onload="iniNumber(1);">
<form action="index.php" target="_self" method="Get" name="OddsListForm">
<table class="G_Table" cellspacing="1" cellpadding="0">
<tr>
	<td colspan="10" class="G_Title" align="left"><?php print $_strRealBet10M["Title"];?> (List)</td>
</tr>
<tr>
	<td colspan="10" class="MyUp">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="right" class="G_Menu">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="left"><a class="G_text"><?php print $_strRealBet10M["LottoKind"];//種類：?><?php print MakeLottoSelect($_arrLotto, $intLottoID, "LottoID", "LottoSelect()", $_intLang)?></a></td>
		<td align="left">
		<select onchange="ChangeReal(this)">
			<option value="0">-<?php print $_strRealBet10M["AllBet"];?>-</option>
			<option value="1" selected>-<?php print $_strRealBet10M["RealBet"];?>-</option>
			<?php
			if(($arrPower[1] == "director" || $arrPower[1] == "director-sub") && $_SESSION["Admin_Info"] -> isAllAccount == 1){
				?><option value="2">-<?php print $_strRealBet10M["CompBet"];?>-</option><?php
			}
			?>
		</select>&nbsp;
		<a class="G_text"><?php print $_strRealBet10M["RefreshWay"];//更新：?></a>
		<select onchange="ChangeRefreshSec(this)">
			<option value="">-No-</option>
			<option value="10">10 sec</option>
			<option value="20">20 sec</option>
			<option value="30">30 sec</option>
			<option value="40">40 sec</option>
			<option value="50">50 sec</option>
			<option value="60">60 sec</option>
		</select>&nbsp;<input type="button" class="submit" value="<?php print $_strRealBet10M["Reset"];//重新整理?>" onclick="isLimit = true;RefreshType();"> </td>
		<td align="left"><a class="G_text"><?php print $_strRealBet10M["LineKind"];//分盤：?></a>
		<select name="GambleType" onchange="ChangeGambleType(this)">
			<option value="1"<?php print ($_data["GameType"] == "1")?" selected":"";?>>A</option>
			<option value="2"<?php print ($_data["GameType"] == "2")?" selected":"";?>>B</option>
			<option value="3"<?php print ($_data["GameType"] == "3")?" selected":"";?>>C</option>
		</select>
		</td>
		<td align="right" valign="bottom" width="480" style="font-size: <?php print ($_intLang == 3)?"1":"8";?>px">
		<!--########## 特碼 ##########//-->
			<a href="JavaScript:ChangeBet(1)" id="M_OETG" class="while_link"><?php print $_strRealBet10M["SpecialNumber"];//特碼?></a>
		<!--########## 平碼 1-4  ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(5)" id="M_CS" class="while_link"><?php print $_strRealBet10M["NormalSpecial"];//平碼?></a>
		<!--########## 平碼1-4 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(11)" id="M_CS" class="while_link"><?php print $_strRealBet10M["NormalNumber1_4"];//平碼1-4?></a>
		<!--########## 連碼 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(15)" id="M_CS" class="while_link"><?php print $_strRealBet10M["JoinNumber"];//連碼?></a>
		<!--########## 平碼過關 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(14)" id="M_CS" class="while_link"><?php print $_strRealBet10M["NormalNumberParlays"];//平碼過關?></a>
		<!--########## 尾數 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(29)" id="M_CS" class="while_link"><?php print $_strRealBet10M["Mantissa"];//尾數?></a>
		<!--########## 五不中 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(25)" id="M_CS" class="while_link"><?php print $_strRealBet10M["FiveNotWin"];//五不中?></a>
		<!--########## 尾數連 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(30)" id="M_CS" class="while_link"><?php print $_strRealBet10M["MantissaJN"];//尾數連?></a>
		<!--########## 已開獎 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:StartGame()" id="M_CS" class="while_link"><?php print $_strRealBet10M["StartGame"];//已開獎?></a>
		</td>
	</tr>
</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td colspan="10" class="G_OutSubMenu">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="right" class="G_SubMenu">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="left" class="G_SubMenuCon" width="70%"><?php print $_strRealBet10M["ListStatus"];//目前表單狀態：?><a id="ListStatus" class="G_Sec">Special Ball</a>&nbsp;--&nbsp;<?php print $_strRealBet10M["GameNo"];//期數?><b style="font-size: 16">&nbsp;:&nbsp;</b><a class="G_Sec"><?php print $arrGamble["SerialNo"];?></a>&nbsp;--&nbsp;<?php print $_strRealBet10M["GameTime"];//時間?><b style="font-size: 16">&nbsp;:&nbsp;</b><a class="G_Sec"><?php print $_strGDate;?></a></td>
		<td align="center" class="G_SubMenuCon">&nbsp;</td>
		<td align="right" class="G_SubMenuCon"><?php print $_strRealBet10M["RefreshSec"];//更新秒數：?><a class="G_Sec" id="RSec">--</a></td>
	</tr>
</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td><span id="BetList"></span></td>
</tr>
</table>
</form>
<!----------------------下注明細圖層---------------------------->
<div id="wager_win" style="display: none;position:absolute">
<table width="120" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr><td bgcolor="#FFFFFF">
<table width="120" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
<tr bgcolor="0163A2"> 
<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;<?php print $_strRealBet10M["WagerList"];?></td>
<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_WagerWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
</tr>
<tr bgcolor="#000000"><td colspan="2" height="1"></td></tr>
<tr bgcolor="#FFCC66"> 
<td colspan="2">
<div style="height:300px; overflow:auto; overflow-x:hidden;" id="WagerLayer">
<table id="WagerTable" class="MyTable" cellspacing="1" cellpadding="3" style="width: 483px;">
<tr align="center">
	<td width="60" class="MyTitleL"><?php print $_strRealBet10M["WGameTime"];?></td>
	<td width="80" class="MyTitleL"><?php print $_strRealBet10M["WAccount"];?></td>
	<td width="170" class="MyTitleL"><?php print $_strRealBet10M["WCont"];?></td>
	<td width="70" class="MyTitleL"><?php print $_strRealBet10M["WStake"];?></td>
	<td width="70" class="MyTitleL"><?php print $_strRealBet10M["WResult"];?></td>
</tr>
</table>
</div>
</td></tr></table>
</td></tr></table>
</div>
<!----------------------下注明細圖層----------------------------> 
<iframe src="" width="50" height="50" name="getData" frameBorder="0" scrolling="no"></iframe>
<form action="index.php" target="getData" name="getDataForm">
<input type="hidden" name="op" value="GetOdds">
<input type="hidden" name="LottoID" value="<?php print $intLottoID;?>">
<input type="hidden" name="GambleID" value="<?php print $intGID;?>">
<input type="hidden" name="Bet_Type" value="1,2,3,4">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isStopBet" value="1">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="strLottoNumber" value="<?php print $_strNumber;?>">
<input type="hidden" name="ChangeGameType" value="No">
<input type="hidden" name="GameType" value="<?php print $_data["GameType"];?>">
<input type="hidden" name="SpecialNumType" value="1">
</form>
</body>
</html>